UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Sb9Idps/7PYiR4POlFjx53gmhmi2fYA0o3nx+7uCY8='
WHERE
key_id = 'c526af8de8cce649cae6fded13e36335ebd364eb48dfdc83e169611e95b30c04'
AND (
token = '8Sb9Idps/7PYiR4POlFjx53gmhmi2fYA0o3nx+7uCY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)