UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kuomoJcdtMgBPlLbY58DzNzzTFV4rlIRTRLgynAmA+o='
WHERE
key_id = 'c1a3606f005d5c54e4e6d3abf1a894514e42d378f245cb4f3559a5a6da16ef73'
AND (
token = 'kuomoJcdtMgBPlLbY58DzNzzTFV4rlIRTRLgynAmA+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)