UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qltje5iY0z0Dtx6vOG6hiiT3d40BBI/hox02pwEBmDI=' 
WHERE 
  key_id = '00b45a721fd9bb6de439796935818041849efa8bb5ce434fce3832cffc8edfa1' 
  AND (
    token = 'qltje5iY0z0Dtx6vOG6hiiT3d40BBI/hox02pwEBmDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032