UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HQdHyE6UxX/A6Z2H/Lixd78UThTjWpqABQeW1gP58Mo='
WHERE
key_id = '07c60fb84c1f4bba84147d72d1be82df4a4b5937851349c16b9e57c51f02dcd1'
AND (
token = 'HQdHyE6UxX/A6Z2H/Lixd78UThTjWpqABQeW1gP58Mo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)