UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'glABh6f9oGFDeCeSgsDhlK2xeOmk/LXUSx/87uzPiII='
WHERE
key_id = 'a9abe51c62c0ddb9164b34fc6e079af36deb607f3ad31220920508a5e22cc700'
AND (
token = 'glABh6f9oGFDeCeSgsDhlK2xeOmk/LXUSx/87uzPiII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)