UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ifP7KOURWCpJvggPa2vjeocKTrEMvzV42NQohPo/qvA='
WHERE
key_id = '68c171155a343eaa8df97dc5424d7cb0e652db1997fecb568d9b1dfd8aa075ff'
AND (
token = 'ifP7KOURWCpJvggPa2vjeocKTrEMvzV42NQohPo/qvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)