UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bLNeGUspb8m2sMUqvHWSrI7N14/t9bEuhDqJFvEhhYQ='
WHERE
key_id = 'e7c2f517eb2db4044c7e253ef84fec715e1f799092e34330f0d066afa418635c'
AND (
token = 'bLNeGUspb8m2sMUqvHWSrI7N14/t9bEuhDqJFvEhhYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)