UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VlG0Z/EjgBCzddzCRZ7IHF4rkK0H4LcAMJ9r0DiipWw='
WHERE
key_id = 'f6e5ad13dc223a560ef50ef2bec57a156fb82d8cf1d90eb81a64fb6b7d7cc3bc'
AND (
token = 'VlG0Z/EjgBCzddzCRZ7IHF4rkK0H4LcAMJ9r0DiipWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)