UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i9DMs4pa+05utwQ6oMBBSx/Sf6iJWyzZMqFD93Bfu8o='
WHERE
key_id = 'd40c7f2275a4ca70cc99ab00cde9daa6eaa7aaf16db2179f081da7edcae590df'
AND (
token = 'i9DMs4pa+05utwQ6oMBBSx/Sf6iJWyzZMqFD93Bfu8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)