UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4dljhqAVySxAVdEJbezEhJU4r9CgIDMZXtkrCMqwaNU='
WHERE
key_id = '8a13a0a516d2db1cc4412f3c8d62ae853d2d63e4ebdc710abc11b93e309b03c7'
AND (
token = '4dljhqAVySxAVdEJbezEhJU4r9CgIDMZXtkrCMqwaNU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)