UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ahoKeljL5+iuXJuaq4lqDYrw/mlKz56oEuk5kt5q2QY='
WHERE
key_id = 'f6e919110050ff7a2b5e7f0e2ec556cdb177b162d47a7af80e1e1c0cc0de3ed8'
AND (
token = 'ahoKeljL5+iuXJuaq4lqDYrw/mlKz56oEuk5kt5q2QY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)