UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0GCY8suRmivm8a4z2krOQpzHBPJ3x+5byjoJ6SpCzrI='
WHERE
key_id = '64d3a783e58d191dcbcdc64f56a83bfd933e7e80b2a67a9fdc4f50112f053330'
AND (
token = '0GCY8suRmivm8a4z2krOQpzHBPJ3x+5byjoJ6SpCzrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)