UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SPcxRniuBCeKknSxXLPvHULeDjN49hm9HOZpldtvVCk='
WHERE
key_id = 'c37cc574651da054ab8f1a5a7aeb8d9ce425641e50616bed8bdd4310a9d3a1b5'
AND (
token = 'SPcxRniuBCeKknSxXLPvHULeDjN49hm9HOZpldtvVCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)