UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tGa3WesicIQOYcgRZhMBRcEEZwpJkS2XOoDTWwVpxO8='
WHERE
key_id = '606dea81298dc773aea3897b3dccefca47b98b054f2dd95b5405cfd74182896f'
AND (
token = 'tGa3WesicIQOYcgRZhMBRcEEZwpJkS2XOoDTWwVpxO8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)