UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JutbzVx7Rao9EJrY6cI9tj7jA7bh953Xifb/0cEmCzk='
WHERE
key_id = 'cee10a1570fb5cdf5de282e1230626aa92347a9e31c2fdf342971f9218428660'
AND (
token = 'JutbzVx7Rao9EJrY6cI9tj7jA7bh953Xifb/0cEmCzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)