UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+sp2/K/XB7ub98Im1+8gPjeFBwTPWbaKvzfrqlo8Ez0='
WHERE
key_id = '1f3646c8a48a5177907c443d5507fe242388440742964c4027779848d5383880'
AND (
token = '+sp2/K/XB7ub98Im1+8gPjeFBwTPWbaKvzfrqlo8Ez0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)