UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HZutmA4b9AXa9WadWXDel72pN6bDl5yaF0LMDIuYmH8='
WHERE
key_id = '7d724352465a0c02c8e99aed691570dd8c1d93f5355e3141c4b2d65753fb061c'
AND (
token = 'HZutmA4b9AXa9WadWXDel72pN6bDl5yaF0LMDIuYmH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)