UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V9F8ianeDFJgTyJOb6e64kIk6zdx4IGGMBLFTeqDIvQ='
WHERE
key_id = 'e0c8d1519247694f83a7fba5e39f11b7fafeb781371c85fb3ed3c31ab0cc75d8'
AND (
token = 'V9F8ianeDFJgTyJOb6e64kIk6zdx4IGGMBLFTeqDIvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)