UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jj4mM3UHL0bEyxS2yA/NQGovOX5lSUX/gHHoSH3bfiI='
WHERE
key_id = '42661dd8988e989493401216017155727262225aa41e51db82fb9ee817c1e8fa'
AND (
token = 'jj4mM3UHL0bEyxS2yA/NQGovOX5lSUX/gHHoSH3bfiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)