UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LfhQrDiP2oAHjyivXlrUPxiIhIakOHUzkD/ojGl93uk='
WHERE
key_id = 'cac1a7ee817aef869c944ee957b045c180216456658bdf174bb825e2df6413a4'
AND (
token = 'LfhQrDiP2oAHjyivXlrUPxiIhIakOHUzkD/ojGl93uk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)