UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NrB97G6nsOj3t0MteZTrDx01dydGj/mG47oLYrNeoMY='
WHERE
key_id = '2ea482dcff2a3cbb12b9c64e8aeb5fcc74222804d42b275356e1fecc11720f10'
AND (
token = 'NrB97G6nsOj3t0MteZTrDx01dydGj/mG47oLYrNeoMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)