UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fQVLOnnf/WRQPLY+C8sl0CMUeNbe905rzYWxD7nvGis='
WHERE
key_id = 'f37ed92339ed7f8c48f3c524aee01216366e463141c8ebe92d9b8276d1fbc2d5'
AND (
token = 'fQVLOnnf/WRQPLY+C8sl0CMUeNbe905rzYWxD7nvGis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)