UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eWXJ+9xAfAeU45KfdRjhcBgflONWUpRuXL3JdK/2oQQ='
WHERE
key_id = 'a83df2fabc06e98d8050e72578d43f7fc210438b7666941bbe6f8a7b6fa6f662'
AND (
token = 'eWXJ+9xAfAeU45KfdRjhcBgflONWUpRuXL3JdK/2oQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)