UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XwAgevaT/yzO2dZfFDHCUdkRUD5nk8eNwzsvqfqsHpg='
WHERE
key_id = '8632564c0f99e819c689d6c105a013f01869bb3f4902112a5a1dc5b8e1cac24b'
AND (
token = 'XwAgevaT/yzO2dZfFDHCUdkRUD5nk8eNwzsvqfqsHpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)