UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6JqvBygu+okcpesUIGwBmq6cAWee1tHXr7Pxo0rb5Ao=' 
WHERE 
  key_id = '2f81ee01643a8be2f3069cb723487d9eb6ac21456944db45e63ccf2902111bd7' 
  AND (
    token = '6JqvBygu+okcpesUIGwBmq6cAWee1tHXr7Pxo0rb5Ao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018