UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OPcWJnSZMi+jCp6W8bkScpe7Q+qE1wjt+CQR8lmUmsg='
WHERE
key_id = 'fc97de2b50e7b0160957eceb8e4bc259e54992ba939b2930b545d1c2a67b50eb'
AND (
token = 'OPcWJnSZMi+jCp6W8bkScpe7Q+qE1wjt+CQR8lmUmsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)