UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gMHqq1No8RZkv8DYuTgRdL4X2GCuez8wp7alFHGCLHI='
WHERE
key_id = '929b6555d3f8a35e0083955139350b3c3d0e55d456b110aac6ce88ced882a2ab'
AND (
token = 'gMHqq1No8RZkv8DYuTgRdL4X2GCuez8wp7alFHGCLHI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)