UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KgL84mVC27cNsK6tiiiyEDRsORuNSbaQUpDB/bUaNsw='
WHERE
key_id = '83135b2dfa0e4e49b419d3f5826401b707d0b3223a9d481e59efc5eb70f3bd7a'
AND (
token = 'KgL84mVC27cNsK6tiiiyEDRsORuNSbaQUpDB/bUaNsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)