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