UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K3uyki54FKuJ6h3a2n8b7QTNifx+fxrrwcFX9K3Ei1U='
WHERE
key_id = 'fd53fc8508d06dddad1dfdf2c30f03a68d5e70c32a51f02ae8245f4112a6674e'
AND (
token = 'K3uyki54FKuJ6h3a2n8b7QTNifx+fxrrwcFX9K3Ei1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)