UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SfVp/w3VIraiqvMWVkzjlLOoYnmkM+8ohsoBxYnKn2s='
WHERE
key_id = 'c60008a2403b0bde885023d016ee4fef59503383f8376dcf7822ce5ccddafe01'
AND (
token = 'SfVp/w3VIraiqvMWVkzjlLOoYnmkM+8ohsoBxYnKn2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)