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